package com.example.helloworld;

public class Counter {
    private static int count = 0;
    // 构造器
    public  Counter() {
        count++;
    }
    public static int getCount() {
        return count;
    }

    public static void main(String[] args) {
        Counter c1 = new Counter();
        Counter c2 = new Counter();
        Counter c3 = new Counter();
        Counter c4 = new Counter();
        System.out.println("Count: " + Counter.getCount());
    }
}
